-------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\rhhaefen\Dropbox\EPA_WQ_Grant_Survey_Files\Final_Data_Public\log\1-impute.log
  log type:  text
 opened on:  21 Jan 2023, 17:18:40

. log off ;
      name:  <unnamed>
       log:  C:\Users\rhhaefen\Dropbox\EPA_WQ_Grant_Survey_Files\Final_Data_Public\log\1-impute.log
  log type:  text
 paused on:  21 Jan 2023, 17:18:40
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\rhhaefen\Dropbox\EPA_WQ_Grant_Survey_Files\Final_Data_Public\log\1-impute.log
  log type:  text
resumed on:  21 Jan 2023, 17:18:40

. preserve ;

.    d income gender age fulltime retired own_home hs_diploma college adults kids black hisp_latino ;

              storage   display    value
variable name   type    format     label      variable label
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
income          float   %9.0g                 Q59 - Household Income
gender          byte    %9.0g                 Q55 - Gender (= 1 if Male)
age             byte    %9.0g                 Q56 - Age
fulltime        float   %9.0g                 = 1 if employed fulltime
retired         float   %9.0g                 = 1 if retired
own_home        float   %9.0g                 = 1 if respondent owns home
hs_diploma      float   %9.0g                 = 1 if respondent has a high school diploma
college         float   %9.0g                 = 1 if respondent has a 4-year college degree
adults          byte    %9.0g                 Q69 - Adults >= 18
kids            byte    %9.0g                 Q70 - Kids < 18
black           byte    %9.0g                 Q64 - 1 if Black or African American
hisp_latino     byte    %9.0g                 Q63 - 1 if Hispanic, Latino or Spanish origin

.    foreach var of varlist income gender age fulltime retired own_home hs_diploma college adults kids black hisp_latino { ;
  2.       replace `var' = . if `var' == -1 ;
  3.    } ;
(268 real changes made, 268 to missing)
(156 real changes made, 156 to missing)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(156 real changes made, 156 to missing)
(169 real changes made, 169 to missing)

.    tab county ;

  County of |
  residence |
(G=Guilford |
  , W=Wake, |
M=Mecklenbu |
        rg) |      Freq.     Percent        Cum.
------------+-----------------------------------
          G |        810       32.26       32.26
          M |        703       28.00       60.25
          W |        998       39.75      100.00
------------+-----------------------------------
      Total |      2,511      100.00

.    sum income gender age fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "W" ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      income |        886    110056.4     64977.7      10000     225000
      gender |        933    .5080386    .5002035          0          1
         age |        921    50.57438    16.61976         18         90
    fulltime |        934    .5942184    .4913057          0          1
     retired |        934    .2291221    .4204931          0          1
-------------+---------------------------------------------------------
    own_home |        935    .7754011    .4175413          0          1
  hs_diploma |        936    .9978632    .0462003          0          1
     college |        936    .7735043    .4187873          0          1
      adults |        929           2    .8820529          1          7
        kids |        929    .6350915    1.072429          0         10
-------------+---------------------------------------------------------
       black |        930    .1225806    .3281317          0          1
 hisp_latino |        926    .0475162    .2128552          0          1

.    sum income gender age fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "G" ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      income |        729    85024.01    60597.06      10000     225000
      gender |        761    .4191853    .4937503          0          1
         age |        755    52.37616     17.0813         18         90
    fulltime |        763     .525557     .499674          0          1
     retired |        763    .2712975    .4449209          0          1
-------------+---------------------------------------------------------
    own_home |        762    .7454068    .4359184          0          1
  hs_diploma |        762    .9829396    .1295814          0          1
     college |        762    .6377953    .4809532          0          1
      adults |        759    2.001318    .9253101          1         10
        kids |        758    .5316623    .9945294          0          6
-------------+---------------------------------------------------------
       black |        759    .1870883    .3902395          0          1
 hisp_latino |        757    .0475561    .2129659          0          1

.    sum income gender age fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "M" ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      income |        628    99474.52    65535.48      10000     225000
      gender |        661    .4931921    .5003323          0          1
         age |        653    50.53139    16.55158         18         90
    fulltime |        663    .5671192    .4958486          0          1
     retired |        663    .2171946    .4126475          0          1
-------------+---------------------------------------------------------
    own_home |        662     .723565    .4475727          0          1
  hs_diploma |        662    .9879154    .1093463          0          1
     college |        662    .7522659     .432023          0          1
      adults |        658     1.99848    .9500448          1          7
        kids |        656    .5838415    1.003345          0          6
-------------+---------------------------------------------------------
       black |        666    .1726727    .3782481          0          1
 hisp_latino |        659    .0591806    .2361416          0          1

. restore ;

. foreach y of varlist gender age fulltime retired own_home water_bill hs_diploma college adults kids { ;
  2.    imp1 `y' ;
  3. } ;

VARIABLE: gender
County      % Missing       Mean
--------------------------------
Guilford    6.0493827    .41918528
Mecklenburg 5.9743954    .49319213
Wake        6.5130261    .50803859

VARIABLE: age
County      % Missing       Mean
--------------------------------
Guilford    6.7901235    52.376159
Mecklenburg 7.1123755    50.531394
Wake        7.7154309    50.574376

VARIABLE: fulltime
County      % Missing       Mean
--------------------------------
Guilford    5.8024691    .52555701
Mecklenburg 5.6899004    .56711916
Wake        6.4128257    .59421842

VARIABLE: retired
County      % Missing       Mean
--------------------------------
Guilford    5.8024691    .27129751
Mecklenburg 5.6899004    .21719457
Wake        6.4128257    .22912206

VARIABLE: own_home
County      % Missing       Mean
--------------------------------
Guilford    5.9259259    .74540682
Mecklenburg 5.8321479    .72356495
Wake        6.3126253    .77540107

VARIABLE: water_bill
County      % Missing       Mean
--------------------------------
Guilford    1.3580247    .75219024
Mecklenburg 3.5561878    .9100295
Wake        1.2024048    .89553753

VARIABLE: hs_diploma
County      % Missing       Mean
--------------------------------
Guilford    5.9259259    .98293963
Mecklenburg 5.8321479    .98791541
Wake        6.2124248    .99786325

VARIABLE: college
County      % Missing       Mean
--------------------------------
Guilford    5.9259259    .63779528
Mecklenburg 5.8321479    .75226586
Wake        6.2124248    .77350427

VARIABLE: adults
County      % Missing       Mean
--------------------------------
Guilford    6.2962963    2.0013175
Mecklenburg 6.401138    1.9984802
Wake        6.9138277    2

VARIABLE: kids
County      % Missing       Mean
--------------------------------
Guilford    6.4197531    .53166227
Mecklenburg 6.685633    .58384146
Wake        6.9138277    .6350915

. foreach y of varlist native asian black white hawaii other hisp_latino { ;
  2.    imp1 `y' ;
  3. } ;

VARIABLE: native
County      % Missing       Mean
--------------------------------
Guilford    6.2962963    .01844532
Mecklenburg 5.2631579    .01201201
Wake        6.8136273    .01612903

VARIABLE: asian
County      % Missing       Mean
--------------------------------
Guilford    6.2962963    .03030303
Mecklenburg 5.2631579    .05105105
Wake        6.8136273    .06451613

VARIABLE: black
County      % Missing       Mean
--------------------------------
Guilford    6.2962963    .18708827
Mecklenburg 5.2631579    .17267267
Wake        6.8136273    .12258065

VARIABLE: white
County      % Missing       Mean
--------------------------------
Guilford    6.2962963    .71014493
Mecklenburg 5.2631579    .7012012
Wake        6.7134269    .7905478

VARIABLE: hawaii
County      % Missing       Mean
--------------------------------
Guilford    6.2962963    0
Mecklenburg 5.2631579    0
Wake        6.8136273    0

VARIABLE: other
County      % Missing       Mean
--------------------------------
Guilford    6.2962963    .07509881
Mecklenburg 5.2631579    .07357357
Wake        6.8136273    .05913978

VARIABLE: hisp_latino
County      % Missing       Mean
--------------------------------
Guilford    6.5432099    .04755614
Mecklenburg 6.2588905    .05918058
Wake        7.2144289    .0475162

. sum income ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      income |      2,511    88395.95    68267.97         -1     225000

. gen inc_reported = (income~=-1) ;

. label var inc_reported "=1 if R reported HH income" ;

. gen w_county = (county == "W") ;

. gen g_county = (county == "G") ;

. gen m_county = (county == "M") ;

. gen age2 = age^2 ;

. /* ASCERTAINING WHAT INCOME NON-RESPONSE IS CORRELATED WITH */
> 
> probit inc_reported gender age age2 fulltime retired own_home water_bill hs_diploma college adults kids native asian black white hawaii other hisp_latino w_count
> y g_county m_county, robust ;

note: hawaii omitted because of collinearity
note: m_county omitted because of collinearity
Iteration 0:   log pseudolikelihood = -852.79672  
Iteration 1:   log pseudolikelihood = -777.99813  
Iteration 2:   log pseudolikelihood = -771.45787  
Iteration 3:   log pseudolikelihood = -771.38741  
Iteration 4:   log pseudolikelihood = -771.38738  

Probit regression                               Number of obs     =      2,511
                                                Wald chi2(19)     =     143.79
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -771.38738               Pseudo R2         =     0.0955

------------------------------------------------------------------------------
             |               Robust
inc_reported |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |   .0536948   .0668658     0.80   0.422    -.0773597    .1847493
         age |  -.1687729   .0253875    -6.65   0.000    -.2185314   -.1190144
        age2 |   .0015697   .0002552     6.15   0.000     .0010694    .0020699
    fulltime |   .0407995   .0853502     0.48   0.633    -.1264838    .2080828
     retired |  -.4616754   .1238363    -3.73   0.000    -.7043901   -.2189607
    own_home |    .000997   .0824127     0.01   0.990     -.160529     .162523
  water_bill |   .0934847   .1012785     0.92   0.356    -.1050175    .2919869
  hs_diploma |  -.2407496   .1808833    -1.33   0.183    -.5952744    .1137751
     college |  -.0083772   .0743834    -0.11   0.910     -.154166    .1374117
      adults |   .0089427   .0329661     0.27   0.786    -.0556697     .073555
        kids |   .0052371   .0341836     0.15   0.878    -.0617616    .0722357
      native |   .7158247   .4246166     1.69   0.092    -.1164086    1.548058
       asian |   .9138552   .3267791     2.80   0.005       .27338     1.55433
       black |   1.224736   .2835958     4.32   0.000     .6688986    1.780574
       white |   1.116944   .2801966     3.99   0.000     .5677693     1.66612
      hawaii |          0  (omitted)
       other |   .9190222   .3214348     2.86   0.004     .2890216    1.549023
 hisp_latino |   .0511061   .1433077     0.36   0.721    -.2297719    .3319841
    w_county |  -.0638187   .0862178    -0.74   0.459    -.2328025    .1051652
    g_county |    .068651   .0937645     0.73   0.464     -.115124     .252426
    m_county |          0  (omitted)
       _cons |   4.588025    .715612     6.41   0.000     3.185451    5.990599
------------------------------------------------------------------------------
Note: 0 failures and 1 success completely determined.

. /* IMPUTING MISSING INCOMES BY COUNTY */
> 
> sum gender age age2 fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "W" ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      gender |        998    .5080386    .4836232          0          1
         age |        998    50.57438    15.96508         18         90
        age2 |        998    2812.396    1672.707        324       8100
    fulltime |        998    .5942184    .4752751          0          1
     retired |        998    .2291221     .406773          0          1
-------------+---------------------------------------------------------
    own_home |        998    .7754011    .4041339          0          1
  hs_diploma |        998    .9978632    .0447407          0          1
     college |        998    .7735043    .4055568          0          1
      adults |        998           2    .8509833          1          7
        kids |        998    .6350915    1.034653          0         10
-------------+---------------------------------------------------------
       black |        998    .1225806     .316744          0          1
 hisp_latino |        998    .0475162    .2050253          0          1

. sum gender age age2 fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "G" ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      gender |        810    .4191853    .4785638          0          1
         age |        810    52.37616    16.49044         18         90
        age2 |        810    3014.861    1724.165        324       8100
    fulltime |        810     .525557    .4849422          0          1
     retired |        810    .2712975    .4318034          0          1
-------------+---------------------------------------------------------
    own_home |        810    .7454068    .4227886          0          1
  hs_diploma |        810    .9829396    .1256785          0          1
     college |        810    .6377953     .466467          0          1
      adults |        810    2.001318    .8956692          1         10
        kids |        810    .5316623    .9620359          0          6
-------------+---------------------------------------------------------
       black |        810    .1870883    .3777388          0          1
 hisp_latino |        810    .0475561    .2058717          0          1

. sum gender age age2 fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "M" ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      gender |        703    .4931921    .4851342          0          1
         age |        703    50.53139    15.95125         18         90
        age2 |        703    2807.502    1671.716        324       8100
    fulltime |        703    .5671192    .4815147          0          1
     retired |        703    .2171946    .4007187          0          1
-------------+---------------------------------------------------------
    own_home |        703     .723565    .4343059          0          1
  hs_diploma |        703    .9879154    .1061051          0          1
     college |        703    .7522659    .4192172          0          1
      adults |        703     1.99848    .9190904          1          7
        kids |        703    .5838415     .969175          0          6
-------------+---------------------------------------------------------
       black |        703    .1726727    .3681451          0          1
 hisp_latino |        703    .0591806    .2286214          0          1

. eststo clear ;

. replace income = . if income == -1 ;
(268 real changes made, 268 to missing)

. eststo: poisson income gender age age2 fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "W", robust ;

Iteration 0:   log pseudolikelihood =  -11689995  
Iteration 1:   log pseudolikelihood =  -11689757  
Iteration 2:   log pseudolikelihood =  -11689757  

Poisson regression                              Number of obs     =        886
                                                Wald chi2(12)     =     496.32
                                                Prob > chi2       =     0.0000
Log pseudolikelihood =  -11689757               Pseudo R2         =     0.3356

------------------------------------------------------------------------------
             |               Robust
      income |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |   .1106014   .0348991     3.17   0.002     .0422004    .1790024
         age |   .0400237   .0090412     4.43   0.000     .0223033    .0577441
        age2 |  -.0003733   .0000943    -3.96   0.000    -.0005581   -.0001884
    fulltime |   .2263164   .0598038     3.78   0.000     .1091031    .3435296
     retired |  -.0274547   .0789778    -0.35   0.728    -.1822484     .127339
    own_home |   .3474403   .0535431     6.49   0.000     .2424977    .4523829
  hs_diploma |    .458858   .3917765     1.17   0.242    -.3090098    1.226726
     college |   .3770748   .0494937     7.62   0.000     .2800689    .4740807
      adults |   .1038317   .0201743     5.15   0.000     .0642909    .1433725
        kids |    .025983   .0165453     1.57   0.116    -.0064451    .0584112
       black |  -.1580234   .0545243    -2.90   0.004    -.2648891   -.0511578
 hisp_latino |  -.0915642   .0710815    -1.29   0.198    -.2308814     .047753
       _cons |   9.174364   .4369897    20.99   0.000      8.31788    10.03085
------------------------------------------------------------------------------
(est1 stored)

. predict inc1 ;
(option n assumed; predicted number of events)

. replace income = inc1 if income == . & county == "W" ;
(112 real changes made)

. drop inc1 ;

. eststo: poisson income gender age age2 fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "G", robust ;

Iteration 0:   log pseudolikelihood =  -10483174  
Iteration 1:   log pseudolikelihood =  -10482935  
Iteration 2:   log pseudolikelihood =  -10482935  

Poisson regression                              Number of obs     =        729
                                                Wald chi2(12)     =     265.71
                                                Prob > chi2       =     0.0000
Log pseudolikelihood =  -10482935               Pseudo R2         =     0.3127

------------------------------------------------------------------------------
             |               Robust
      income |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |   .1480073    .046279     3.20   0.001     .0573021    .2387125
         age |  -.0019365   .0101433    -0.19   0.849     -.021817    .0179439
        age2 |   .0000275    .000099     0.28   0.781    -.0001665    .0002215
    fulltime |   .4310795   .0806588     5.34   0.000     .2729913    .5891678
     retired |   .1637022   .1037804     1.58   0.115    -.0397036    .3671079
    own_home |   .4559004   .0794862     5.74   0.000     .3001102    .6116905
  hs_diploma |   .2367893   .2822984     0.84   0.402    -.3165055    .7900841
     college |   .3340093   .0572211     5.84   0.000     .2218579    .4461607
      adults |   .1260945   .0264125     4.77   0.000     .0743269    .1778621
        kids |   .0694408   .0236786     2.93   0.003     .0230316      .11585
       black |  -.2183021   .0661043    -3.30   0.001     -.347864   -.0887401
 hisp_latino |  -.1060943   .1270201    -0.84   0.404    -.3550491    .1428605
       _cons |   9.927063   .3566823    27.83   0.000     9.227979    10.62615
------------------------------------------------------------------------------
(est2 stored)

. predict inc1 ;
(option n assumed; predicted number of events)

. replace income = inc1 if income == . & county == "G" ;
(81 real changes made)

. drop inc1 ;

. eststo: poisson income gender age age2 fulltime retired own_home hs_diploma college adults kids black hisp_latino if county == "M", robust ;

Iteration 0:   log pseudolikelihood =   -8866353  
Iteration 1:   log pseudolikelihood = -8865636.2  
Iteration 2:   log pseudolikelihood = -8865635.7  

Poisson regression                              Number of obs     =        628
                                                Wald chi2(12)     =     366.33
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -8865635.7               Pseudo R2         =     0.3482

------------------------------------------------------------------------------
             |               Robust
      income |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |   .0703808   .0445821     1.58   0.114    -.0169985    .1577601
         age |   .0321954   .0096604     3.33   0.001     .0132614    .0511293
        age2 |  -.0003482   .0000997    -3.49   0.000    -.0005436   -.0001528
    fulltime |   .2054343   .0656336     3.13   0.002     .0767948    .3340737
     retired |   .0079346   .1021527     0.08   0.938     -.192281    .2081501
    own_home |   .4870897   .0592269     8.22   0.000     .3710071    .6031724
  hs_diploma |   .4171514   .3491269     1.19   0.232    -.2671247    1.101427
     college |   .4546201   .0652825     6.96   0.000     .3266688    .5825714
      adults |   .0406033   .0249328     1.63   0.103    -.0082641    .0894707
        kids |   .0453392   .0210961     2.15   0.032     .0039917    .0866868
       black |  -.2816241   .0717025    -3.93   0.000    -.4221584   -.1410897
 hisp_latino |  -.1094363   .1239613    -0.88   0.377     -.352396    .1335233
       _cons |   9.466257   .4122647    22.96   0.000     8.658233    10.27428
------------------------------------------------------------------------------
(est3 stored)

.   predict inc1 ;
(option n assumed; predicted number of events)

. replace income = inc1 if income == . & county == "M" ;
(75 real changes made)

. drop inc1 ;

. drop w_county g_county m_county age2 inc_reported ;

. sum income gender age fulltime retired own_home hs_diploma college adults kids asian black white ;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      income |      2,511    99130.84    61630.62      10000     225000
      gender |      2,511    .4752197    .4838155          0          1
         age |      2,511    51.14356    16.14859         18         90
    fulltime |      2,511    .5644826    .4808435          0          1
     retired |      2,511    .2393877    .4138101          0          1
-------------+---------------------------------------------------------
    own_home |      2,511     .751213    .4191645          0          1
  hs_diploma |      2,511    .9902641    .0952711          0          1
     college |      2,511    .7237811    .4338343          0          1
      adults |      2,511           2    .8845735          1         10
        kids |      2,511    .5873789      .99405          0         10
-------------+---------------------------------------------------------
       asian |      2,511    .0497099    .2105026          0          1
       black |      2,511    .1574137    .3529555          0          1
       white |      2,511    .7395972    .4254164          0          1

. log close ;
      name:  <unnamed>
       log:  C:\Users\rhhaefen\Dropbox\EPA_WQ_Grant_Survey_Files\Final_Data_Public\log\1-impute.log
  log type:  text
 closed on:  21 Jan 2023, 17:18:42
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
